package com.mszlu.blog.dao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mszlu.blog.dao.dos.Archives;
import com.mszlu.blog.dao.pojo.Article;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ArticleMapper  extends BaseMapper<Article> {
    /**
     * 获取首页最热文章
     * @param limit
     * @return
     */
    List<Article> hotArticles(int limit);

    /**
     * 获取首页最新文章
     * @param limit
     * @return
     */
    List<Article> newArticles(int limit);

    /**
     * 文章归档
     * @return
     */
    List<Archives> listArchives();

    /**
     * 更新文章
     * @param id
     * @param viewCounts
     */
    void updateByIdAndByViewCount(Long id, Integer viewCounts);
}
